#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;
class Compine
{
private:
	int Getge(int n)const
	{
		return n % 10;
	}
	int Getshi(int n)const
	{
		return (n % 100) / 10;
	}
public:
	int CompineR(int a,int b)const
	{
		return  Getge(b) * 1000 + Getge(a) * 100 + Getshi(b) * 10 + Getshi(a);
	}
};
int main()
{
	int a, b;
	cin >> a >> b;
	Compine C;
	cout << C.CompineR(a, b) << endl;
}